package com.example.chat.model.ro;

import com.example.chat.constant.StaticConstant;
import com.example.chat.type.EmployeeType;
import com.example.chat.type.SexType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.compress.utils.Lists;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;
import java.util.List;

/**
 * @Description
 * @Date 2022/11/17 17:31
 * @Author pq
 */
@Data
public class EmployeeUpdateRO {

    @ApiModelProperty(value = "职员id")
    private String id;

    @ApiModelProperty(value = "姓名")
    @NotBlank(message = "员工姓名不能为空")
    private String name;

    @ApiModelProperty(value = "性别")
    @NotNull(message = "性别不能为空")
    private SexType sex;

    @ApiModelProperty(value = "等级")
    @NotBlank(message = "等级不能为空")
    private String level;

    @ApiModelProperty(value = "公司主体")
    private String companyId;

    @ApiModelProperty(value = "地区")
    private String regionId;

    @ApiModelProperty(value = "员工类型")
    @NotNull(message = "员工类型不能为空")
    private EmployeeType employeeType;

    @ApiModelProperty(value = "部门")
    @NotNull(message = "部门不能为空")
    private String deptId;

    @ApiModelProperty(value = "职位id")
    @NotBlank(message = "职位id不能为空")
    private String positionId;

    @ApiModelProperty(value = "角色id")
    private List<String> roleId = Lists.newArrayList();

    //@ApiModelProperty(value = "户籍类型（户口）")
    //@NotNull(message = "户口不能为空")
    //private HouseholdType householdType;

    @ApiModelProperty(value = "身份证号码")
    @NotBlank(message = "身份证号不能为空")
    private String idCardCode;

    @ApiModelProperty(value = "电话号码")
    @NotBlank(message = "电话号码不能为空")
    @Pattern(regexp = "^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$", message = "电话号码不合法")
    private String phoneNumber;

    @ApiModelProperty(value = "出生日期")
    @DateTimeFormat(pattern = StaticConstant.DATE_FORMAT)
    @NotNull(message = "出生日期不能为空")
    private Date birthDate;

    @ApiModelProperty(value = "入职日期")
    @DateTimeFormat(pattern = StaticConstant.DATE_FORMAT)
    @NotNull(message = "入职日期不能为空")
    private Date entryDate;

    @ApiModelProperty(value = "开户行")
    private String bankAccountSite;

    @ApiModelProperty(value = "银行账号")
    private String bankAccountCode;

    @ApiModelProperty(value = "合同开始")
    @DateTimeFormat(pattern = StaticConstant.DATE_FORMAT)
    @NotNull(message = "合同开始日期不能为空")
    private Date pactStartDate;

    @ApiModelProperty(value = "合同结束")
    @DateTimeFormat(pattern = StaticConstant.DATE_FORMAT)
//    @NotNull(message = "合同结束结束不能为空")
    private Date pactEndDate;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "邮箱")
    @Email(regexp = "^[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$", message = "邮箱格式错误")
    private String email;

    @ApiModelProperty(value = "主管")
    @NotBlank(message = "主管不能为空")
    private String supervisorId;

    @ApiModelProperty(value = "第一次缴纳社保")
    @DateTimeFormat(pattern = StaticConstant.DATE_FORMAT)
    private Date firstSocialDate;

    @ApiModelProperty(value = "账号是否有效（启用和禁用）")
    private Boolean active;

    @ApiModelProperty(value = "导师id")
    private String mentorId;

}
